/**
 * Created by Administrator on 2014/12/3.
 */
var mysql = require('mysql');
//var conn = mysql.createConnection({
//    host: 'localhost',
//    user: 'root',
//    password: 'root',
//    database:'zsmail',
//    port: 3306
//});
//conn.connect();
//conn.query('SELECT 1 + 1 AS solution', function(err, rows, fields) {
//    if (err) throw err;
//    console.log('The solution is: ', rows[0].solution);
//});
//conn.end();
//使用连接池
var pool = module.exports =  mysql.createPool({
    host: '192.168.3.5',
    user: 'ddkjIzRUrXzC6ZHj',
    password: 'nWJnwSHB9HJuVGkx',
    database:'cf_c499f71b_c363_41d0_a4df_93c5e5d6b520',
    port: 3306
});
//var selectSQL = 'select * from zs_user limit 10';
//
//pool.getConnection(function (err, conn) {
//    if (err) console.log("POOL ==> " + err);
//
//    conn.query(selectSQL,function(err,rows){
//        if (err) console.log(err);
//        console.log("SELECT ==> ");
//        for (var i in rows) {
//            console.log(rows[i]);
//        }
//        conn.release();
//    });
//});